# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=centry
pkgver=72.6de2868
pkgrel=10
groups=('blackarch' 'blackarch-misc' 'blackarch-defensive')
pkgdesc='Cold boot & DMA protection'
url='https://github.com/0xPoly/Centry'
arch=('any')
license=('GPL3')
depends=('python' 'python-pmw')
makedepends=('git')
source=("$pkgname::git+https://github.com/0xPoly/Centry.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share"

  cp -aR $srcdir/Centry "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/bash
cd /usr/share/$pkgname
exec python $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

